package com.cj.pojo;



import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class User {
    @NotNull
    private Integer id;//主键ID
    
    private String username;//用户名
    
    @JsonIgnore
    private String password;//密码

    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;//昵称

    @NotEmpty
    @Email
    private String email;//邮箱
    
    private String userPic;//用户头像地址
    
    @Enumerated(EnumType.STRING)
    private UserStatus status;//用户状态
    
    @Enumerated(EnumType.STRING)
    private UserRole role;//用户角色
    
    private LocalDateTime lastLogin;//最后登录时间
    
    private String resetToken;//重置令牌
    
    private LocalDateTime resetExpire;//重置过期时间
    
    private LocalDateTime createTime;//创建时间
    
    private LocalDateTime updateTime;//更新时间
}
